import { join, resolve } from 'path'

export default {
  lintOnSave: false,
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          require("postcss-pxtorem")({
            propList: ["*"],
          }),
        ],
      },
      less: {
        // 这里的选项会传递给 less-loader
        paths: [join(__dirname, 'packages')],
      }
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        'utils': resolve('./packages/utils'),
      }
    },
    plugins: []
  },
  chainWebpack: (config) => {
    config.module
      .rule("tsx | ts")
      .include.add(resolve(__dirname, "packages/components"))
      .end()
      .use("babel")
      .loader("babel-loader")
      .tap((options) => {
        // 修改它的选项...
        return options;
      });
  },
};
